package edu.sctu.wulixia.month6.day20150616;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;

/**
 * Created by user05 on 2015/6/16.
 */
public class HttpUrl {
    public void getHttpUrl(String path) throws IOException {
        URL url = new URL(path);
        InputStream inputStream = url.openStream();
        int count = 0;
        byte[] buffer = new byte[1024];
        while ((count = inputStream.read(buffer)) != -1){
            System.out.println(new String(buffer,0,count));
        }
        inputStream.close();
    }
}
